import ajax from '@/utils/request.js'

export function getCourseList(data) {
    return ajax({
        url: '/storehouse/coursePage',
		method: 'GET',
        data
    })
}

// 获取体系课程详情
export function getCourseDetails(id) {
    return ajax({
        url: '/storehouse/storehouseDetail/' + id,
		method: 'GET'
    })
}


export function addCourse(data) {
    return ajax({
        url: '/storehouse/addCourse',
		method: 'POST',
        data
    })
}

export function editCourse(data, id) {
    return ajax({
        url: '/storehouse/updateCourse/' + id,
		method: 'PUT',
        data
    })
}

export function delCourse(id) {
    return ajax({
        url: '/storehouse/del/' + id,
		method: 'DELETE'
    })
}

// 体系页面头部统计数据
export function countHeaderCourses(data) {
    return ajax({
        url: '/storehouse/countHeaderCourses',
		method: 'GET',
		data
    })
}


// 体系课
export function getOpenCourseList(data) {
    return ajax({
        url: '/storehouse/packagePage',
		method: 'GET',
        data
    })
}

export function addOpenCoursePackage(data) {
    return ajax({
        url: '/storehouse/addPackage',
		method: 'POST',
        data
    })
}

export function delOpenCoursePackage(id) {
    return ajax({
        url: '/storehouse/del/' + id,
		method: 'DELETE'
    })
}

export function editOpenCoursePackage(data, id) {
    return ajax({
        url: '/storehouse/updatePackage/' + id,
		method: 'PUT',
        data
    })
}

// 预约授课时间列表
export function appointmentGiveLessonsList(data) {
	/**
	 * 预约授课时间列表
	 * @param {Object} data
	 * @return requestPromis
	 */
    return ajax({
        url: '/mobile/instructor/index/courseList',
		method: 'GET',
        data,
		hiddenLoading: true
    })
}

export function appointmentGiveLessonsDetail(id) {
	/**
	 * 预约授课课程详情
	 * @param {String} id
	 * @return requestPromis
	 */
    return ajax({
        url: '/storehouse/courseDetailWithId/' + id,
		method: 'GET'
    })
}

// 体系课详情
export function getOpenDetail(id) {
    return ajax({
        url: '/storehouse/packagePage/detail/' + id,
		method: 'GET'
    })
}

// 体系课内课程程详情
export function getOpenCourseDetail(id) {
    return ajax({
        url: '/storehouse/packagePage/classDetail/' + id,
		method: 'GET'
    })
}

